# -*- coding: UTF-8 -*- 
import pyodbc
import pprint
import random

conn = pyodbc.connect("DSN=ORACLE_SAMPLE;UID=qinyi365;PWD=qinyi365")
cursor = conn.cursor()
cursor.execute("select count(*) from TAB_EMPLOYEE;")
records = cursor.fetchall()
print "the count is %d",records[0]
cursor.execute("select * from TAB_EMPLOYEE;")
records = cursor.fetchall()
pprint.pprint(records)
username=u'001'
cursor.execute("select BAR_PASSWORD from TAB_EMPLOYEE where EMPLOYEE_CODE = ?",username.encode('gbk'))
records = cursor.fetchall()
pprint.pprint(records)



